// 设置变量
@bg-color: #b7d4a8;

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font: bold 20px Courier;
}

#main {
  margin: auto;
  border: 10px solid #000;
  border-radius: 20px;
  width: 360px;
  height: 420px;
  background-color: @bg-color;
  display: flex;
  flex-flow: column;
  justify-content: space-around;
  align-items: center;

  #stage {
    width: 304px;
    height: 304px;
    border: 2px solid #000;
    position: relative;

    #snake {
      &>div {
        width: 10px;
        height: 10px;
        background-color: #000;
        border: 1px solid @bg-color;

        // 开启绝对定位用于设置蛇的位置
        position: absolute;
      }
    }

    #food {
      left: 100px;
      top: 150px;
      width: 10px;
      height: 10px;
      border: 1px solid @bg-color;
      position: absolute;
      display: flex;
      flex-flow: row wrap;
      justify-content: space-between;
      align-content: space-between;

      &>div {
        width: 4px;
        height: 4px;
        background-color: #000;
        transform: rotate(45deg);
      }
    }
  }

  #scoreboard {
    display: flex;
    width: 304px;
    justify-content: space-between;
  }
}

#keyboard {
  display: flex;
  flex-wrap: wrap;
  width: 360px;
  height: 100px;
  margin: auto;
  &>div {
    width: 360px;
    display: flex;
    justify-content: space-around;
    i {
      font-size: 40px;
    }
  }
}